package com.io.protocol;

import io.netty.util.AttributeKey;

/**
 * Created by yangyx on 2016/7/21.
 * 根据通信协议
 *[包头 1] [   包长   2] [   TAG   2] [   命令   2] [   正文...   N] [   CRC   2]
 *
 * 长度常量放在该包下
 */
public  class LengthConstants {
    public static final byte ThePackageHeader = 0x7F;
    //包头长度
    public static final int PackageHeaderLength = 1;
    //包长长度
    public static final int PackageSizeLength = 2;
    //TAG长度
    public static final int TagLength = 2;
    //命令长度
    public static final int CommandLength = 2;
    //CRC长度
    public static final int CrcLength = 2;
    //最小包长度:包头+长度+tag+命令+CRC
    public static final int MinPackageLength = PackageHeaderLength + PackageSizeLength + TagLength + CommandLength + CrcLength;
}
